package tjs.study.notes.dotest.zookper.locker;

import org.I0Itec.zkclient.ZkClient;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.event.EventListener;
import tjs.study.notes.dotest.zookper.locker.common.TestLockSegmentCommon;
import tjs.study.notes.dotest.zookper.locker.mini.RLockMiniFactory;

/**
 * Created by Nicky.Tang on 2021/11/9 9:52 下午
 *
 * @since 02.12.10
 */
public class DoTestOfMiniCurator {
    private static final Logger logger = LoggerFactory.getLogger(DoTestOfMiniCurator.class);
    public static String curServerPath = "/nickyLock";

    public static void main(String[] args) throws Exception {
        ZkClient zkClient = new ZkClient("127.0.0.1:2181");
        if (!zkClient.exists(curServerPath)) {
            zkClient.createPersistent(DoTestOfMiniCurator.curServerPath);
        }

        RLockMiniFactory rLockMiniFactory = new RLockMiniFactory(zkClient);

        //TestLockCommon.doTest(rLockMiniFactory, "/bc1111", 500);

        TestLockSegmentCommon testLockSegmentCommon = new TestLockSegmentCommon(rLockMiniFactory);
        testLockSegmentCommon.doTestSegment("/goodsId_123456_activityId_a7893", 10, 10, 7);
    }


}
